package com.laycoding.boot.controller;

import com.laycoding.common.service.GoodService;
import com.laycoding.common.service.UserService;
import com.laycoding.layrpc.config.client.ServiceFactory;
import com.laycoding.layrpc.entity.LayRpcResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/order")
public class TestController {


    @Resource
    private UserService userService;

    @Resource
    private GoodService goodService; 

    @GetMapping("/test")
    public LayRpcResponse test(String name) {
        LayRpcResponse res = userService.getUserName(name);
        //goodService.getGood();
        return res;
    }

    @GetMapping("/user")
    public LayRpcResponse user(String name) {
        LayRpcResponse res = userService.getUser(name);
        return res;
    }
}
